#!/usr/bin/bash
#
#  Usage: add site with example.
#  Issue: 2024-05-17
# Author: Leon Hsia
#   Mail: waxwork3@163.com
#
base_path=$(dirname $(realpath $0))
cd $base_path

cd nginx/conf.d
echo $1 |grep -F '.' >>/dev/null
if [ $? -ne 0 ];then
  echo -e "enter your domain: " 
  read  
  domain=$REPLY
else
  domain=$1
fi
sed 's/examples/'$domain'/' examples >${domain}.conf
